package com.wochao.common.utils;

import java.util.Random;

/**
 * 生成随机验证码
 */
public class VerifyCodeUtil {
    /**
     * 输入长度生成随机验证码
     *
     * @param length
     * @return
     */
    public static String getVerifyCode(Integer length) {
        StringBuilder stringBuilder = new StringBuilder();
        Random random = new Random();
        for(int i   = 0; i < length; i++) {
            stringBuilder.append(random.nextInt(10));
        }

        return stringBuilder.toString();
    }
}
